
package gamefw.gameplugin;

import gamefw.framework.Coordinate;
import gamefw.framework.Move;

public class PlayResult {

	public enum ResultType {
		DO_NOTHING,
		SELECT,
		MOVE,
	}
	
	private ResultType resultType;
	
	private Coordinate position;
	
	private Move move;
	
	private PlayResult(ResultType resultType, Coordinate position, Move move) {
		this.resultType = resultType;
		this.position = position;
		this.move = move;
	}
	
	/**
	 * Creates the play result which indicates the player did not do anything.
	 */
	public PlayResult() {
		this(ResultType.DO_NOTHING, null, null);
	}
	
	/**
	 * Creates the play result which indicates the player did make a selection.
	 * @param position
	 */
	public PlayResult(Coordinate position) {
		this(ResultType.SELECT, position, null);
	}
	
	/**
	 * Creates the play result which indicates the player did make a move.
	 * @param move
	 */
	public PlayResult(Move move) {
		this(ResultType.MOVE, null, move);
	}

	public ResultType getResultType() {
		return resultType;
	}

	public Coordinate getPosition() {
		return position;
	}

	public Move getMove() {
		return move;
	}
}
